<?php
$this->headLink(array('href' => '/cms/styles/style.css', 'rel' => "stylesheet", 'type' => "text/css"));
$this->headScript()
	->appendFile('/cms/scripts/dojo/dojo.js','',array('djConfig'=> 'parseOnLoad:true'))
	->setAllowArbitraryAttributes(true);
?>

<h1>Редактируем пользователя "<?=$this->user->login?>"</h1>>
<?php 
    if( $this->msg ){?>
    <span style='color:red'><?=$this->msg?></span>
<?php } ?>
<div class="textBox">
<form method="POST" action="" class="registerForm">
<table border="0" cellspacing="0" cellpadding="0" class='form'>

<tr>
    <td class="lablel">E-mail:</td><td><input class="modalInput" type="text" name="email" value="<?=$this->user_data['email']?>"></td>
    <td id="email" style='color:red'>&nbsp<?=isset($this->err['wrong_email'])? $this->err['wrong_email'] : ''?></td>    
</tr>

<tr>
    <td class="lablel">Телефон:</td><td><input class="modalInput" type="text" name="phone" value="<?=$this->user_data['phone']?>"></td>
    <td id="email" style='color:red'>&nbsp;</td>    
</tr>

<tr>
    <td class="lablel">Фамилия:</td><td><input class="modalInput" type="text" name="name_f" value="<?=$this->user_data['name_f']?>"></td>
    <td id="name_f" style='color:red'>&nbsp<?=isset($this->err['wrong_name_f'])? $this->err['wrong_name_f'] : ''?></td>    
</tr>

<tr>
    <td class="lablel">Имя:</td><td><input class="modalInput" type="text" name="name_i" value="<?=$this->user_data['name_i']?>"></td>
    <td id="name_i" style='color:red'>&nbsp<?=isset($this->err['wrong_name_i'])? $this->err['wrong_name_i'] : ''?></td>    
</tr>

<tr>
    <td class="lablel">Отчество:</td><td><input class="modalInput" type="text" name="name_o" value="<?=$this->user_data['name_o']?>"></td>
    <td id="name_o" style='color:red'>&nbsp<?=isset($this->err['wrong_name_o'])? $this->err['wrong_name_o'] : ''?></td>    
</tr>

<tr>
    <td class="lablel">Страна:</td><td>
        <select name="country" class="modalInput">
            <option name="country" value="Россия" <?=($this->user_data['country'] == 'Россия')? 'selected': ''?>>Россия</option>
            <option name="country" value="Белорусия" <?=($this->user_data['country'] == 'Белорусия')? 'selected': ''?>>Белорусия</option>
            <option name="country" value="Украина" <?=($this->user_data['country'] == 'Украина')? 'selected': ''?>>Украина</option>        
        </select>
    
    </td>
    <td id="country" style='color:red'>&nbsp<?=isset($this->err['wrong_country'])? $this->err['wrong_country'] : ''?></td>    
</tr>

<tr>
    <td class="lablel">Город:</td><td><input class="modalInput" type="text" name="town" value="<?=$this->user_data['town']?>"></td>
    <td id="town" style='color:red'>&nbsp<?=isset($this->err['wrong_town'])? $this->err['wrong_town'] : ''?></td>    
</tr>

<tr>
    <td class="lablel">Индекс:</td><td><input class="modalInput" type="text" name="index" value="<?=$this->user_data['index']?>"></td>
    <td id="index" style='color:red'>&nbsp<?=isset($this->err['wrong_index'])? $this->err['wrong_index'] : ''?></td>    
</tr>

<tr>
    <td class="lablel">Улица:</td><td><input class="modalInput" type="text" name="street" value="<?=$this->user_data['street']?>"></td>
    <td id="street" style='color:red'>&nbsp<?=isset($this->err['wrong_street'])? $this->err['wrong_street'] : ''?></td>    
</tr>

<tr>
    <td class="lablel" colspan='2' >
        Дом:<input class="modalInput" style="width:60px" type="text" name="house" value="<?=$this->user_data['house']?>">&nbsp&nbsp&nbsp
        Корпус:<input class="modalInput" style="width:60px" type="text" name="korpus" value="<?=$this->user_data['korpus']?>">&nbsp&nbsp&nbsp
        Квартира:<input class="modalInput" style="width:60px" type="text" name="flat" value="<?=$this->user_data['flat']?>">
    </td>
    <td id="street" style='color:red'>&nbsp<?=isset($this->err['wrong_address'])? $this->err['wrong_address'] : ''?></td>    
</tr>

<tr>
    <td align='center' colspan='3'>
        <br />
        <input name = 'btn_save' type="submit" class="okButton" id="okButton" value="Сохранить" />
        <input type="button" class="okButton" value="Отмена" onclick="window.parent.setTimeout('Shadowbox.close()',10)" /></td>
    </td>
</tr>

</table>
</form>		
</div>
